import 'dart:convert';
import 'package:safetymonitor/app/data/common/choice_bean.dart';
import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/dept_resp_entity.g.dart';
export 'package:safetymonitor/generated/json/dept_resp_entity.g.dart';

/// 部门实体
@JsonSerializable()
class DeptRespEntity extends ChoiceBean {
  DeptRespEntity();

  factory DeptRespEntity.fromJson(Map<String, dynamic> json) => $DeptRespEntityFromJson(json);

  ///	部门编号
  late int id = 0;

  ///	部门名称
  late String name = '';

  ///	父部门 ID
  late int parentId = 0;

  ///	显示顺序不能为空
  late int sort = 0;

  ///	负责人的用户编号
  late int leaderUserId = 0;

  ///	联系电话
  late String phone = '';

  ///	邮箱
  late String email = '';

  ///	状态,见 CommonStatusEnum 枚举
  late int status = 0;

  ///	创建时间
  late String createTime = '';

  ///	公司或部门标识,1-部门，2-公司
  late int flag = 0;

  Map<String, dynamic> toJson() => $DeptRespEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id.toString();
  }

  @override
  String getShowName() {
    return name;
  }
}
